<?php

/**
 * OOP Practice Project
 *
 * This file is a subject under proprietary sofrware license
 * 
 * @category
 * @package
 * @subpackage
 * @author      valerii lazarevych <lazarevuch@gmail.com>
 * @copyright   Copyright(c) Valerii Lazarevych
 * @license     proprietary software license
 * @version     $Id: PreviousTasks.php 19.07.2012 17:25:03 valerii $
 */

/**
 * Class PreviousTasks
 *
 */

/*
class ABC
{
    public      $a   =   null;
    protected   $b   =   null;
    private     $c   =   null;
    
    static      $d   =   null;
    
    function __construct() {
        
        $this->a    =   rand(1,256);
        self::$d    =   $this->a;
    }
    
    function getB() {
        return $this->b;
    }
    
    function getC(){
        return $this->c;
    }
    
    function getD(){
        return self::$d;
    }*/

class ABC
{
    public      $a   =   'A_abc';
    protected   $b   =   "b_abc";
    protected     $c   =   'c_abc';
    static      $d   =   'd_abc';
        
    
    function getA()
    {
        echo $this->a;
    }
    
    function getB() {
        echo $this->a.'</br>';
        echo parent::$a.'</br>';
    }
    
    function getC(){       
        return $this->c.'</br>';
    }
   function get_c(){       
        return $this->c.'</br>';
    }
    
    function getD(){
        return self::$d;
    }
};

//   class ABCD{
//        private $abc=null;
//        
//    }
    
class ABCD {
    
    static $inst = null;
    
    protected $c='hello ukraine';
    
    static function Get_inst()
    {
        if(! self::$inst instanceof self){
        
            self::$inst  =  new self;
        }
        return self::$inst;
    }
    
    private function __construct() {       
    }
    
    final function getB(){
        
       return $this->c;
    }
     final function put_b(){
       $this->putB('hello world1');
    }
    private function putB($str='hello world')
    {   
        $this->c=$str;    
    }
}


//echo $obj1->getB()."</br>";

//echo ABCD::Get_inst()->put_b();
//echo ABCD::Get_inst()->getB();

//echo $obj->getB();

$var = "hallow";
//echo "$var world <br/>";
//echo '$var world 2<br/>';

class beers {
    const softdrink = 'rootbeer';
    public static $ale = 'ipa';
    
    static function done(){
        return self::softdrink;
    }
}
/*
echo "class {${beers::done()}}</br>";
echo "class2 {beers::done()}";
print_r ((0.1+0.7) * 10);
$obj = (object) 'ciao';
//var_dump($obj);
echo $obj->scalar;

//
*/
